# -*- coding: utf-8 -*-
from Public.case_load import CasesManager
from Public.parse_data import GetDictParam
from lib import LogHandler
import os, json


__author__ = 'JK'
__date__ = '2019/5/9 23:39'

DEBUG_INFO = 1
CASE_PATH = 'case/'

# class ResData(CasesManager):
#
#     def res_data(self):
#         dict_data = self.make_cases_info()
#         for teststep in dict_data:
#             case = {}
#
#             print(teststep)
#
# x = ResData()
# print(x.res_data())

class TestCaseLoader(GetDictParam, CasesManager):
    """ TestCase Loader"""
    __slots__ = "tags"

    if DEBUG_INFO is 1:
        logger = LogHandler(__name__)
    else:
        logger = LogHandler(__name__, level=30)

    def __init__(self):
        """ init class"""
        super(TestCaseLoader, self).__init__()
        self.files = os.listdir(CASE_PATH)
        self.data = {}
        self.tags = self.make_cases_info()

    def __repr__(self) -> str:
        """
            return repr obj
        :return:
        """
        return json.dumps(self.tags)

x = TestCaseLoader()
print(x)